/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */
package com.raitcon.hibernate.backbean;

/**
 *
 * @author Mike
 */

import java.util.HashMap;
import java.util.Map;
import com.raitcon.reports.common.AbstractReportBean;
import javax.faces.bean.ManagedBean;
import javax.faces.bean.RequestScoped;
import org.apache.log4j.Logger;
 
@ManagedBean(name ="reportsBean")
@RequestScoped
 
public class ReportsBean extends AbstractReportBean {
 
    
    protected static Logger log = Logger.getLogger(ReportsBean.class);
    private final String COMPILE_FILE_NAME = "report1";
 
    @Override
    protected String getCompileFileName() {
        return COMPILE_FILE_NAME;
    }
 
    @Override
    protected Map<String, Object> getReportParameters() {
        Map<String, Object> reportParameters = new HashMap<String, Object>();
 
        reportParameters.put("pdni", "9%");
 
        return reportParameters;
    }
 
    public String execute() {
        try {
            System.out.println("Iniciando llamado de reporte....");
            log.info("Iniciando llamado de reporte....");
            super.prepareReport();
        } catch (Exception e) {
            // make your own exception handling
            log.error("Error Jaspert Report::"+e.getMessage());
             System.out.println("Error...."+e.getMessage());
            e.printStackTrace();
        }
 
        return null;
    }
}